Skip to content

feat: add ai terminal settings#12215

Merged
f2c-ci-robot[bot] merged 1 commit intodev-v2from
feat/ai-terminal-settings
Mar 19, 2026
Merged

feat: add ai terminal settings#12215
f2c-ci-robot[bot] merged 1 commit intodev-v2from
feat/ai-terminal-settings

Conversation

@ssongliu
Copy link
Member

No description provided.

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Mar 18, 2026

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3c75ad00a9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

hostRouter.POST("/search", baseApi.SearchHost)
hostRouter.POST("/tree", baseApi.HostTree)
hostRouter.POST("/test/byinfo", baseApi.TestByInfo)
hostRouter.POST("/test/byid", baseApi.TestByID)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep host test-by-id compatible with the terminal UI

The terminal tab still calls POST /hosts/test/byid/${id} before opening or reconnecting a saved host (frontend/src/api/modules/terminal.ts:45-46, used in frontend/src/views/terminal/terminal/index.vue:512 and :527). Changing the agent route to POST /hosts/test/byid with a JSON body means those checks now 404, so any non-local host tab fails before the websocket connection is even started.

Useful? React with 👍 / 👎.


export const searchHosts = (params: Host.SearchWithPage) => {
return http.post<ResPage<Host.Host>>(`/core/hosts/search`, params);
return http.postLocalNode<ResPage<Host.Host>>(`/hosts/search`, params);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Respect the selected node for terminal host APIs

This module now forces host search/create/update/test requests onto CurrentNode=local, but the terminal websocket still connects with operateNode=${globalStore.currentNode} (frontend/src/components/terminal/index.vue:210). On any remote node, the Host tab will therefore list local-node host IDs, then onConnTerminal opens /api/v2/hosts/terminal?id=... against the remote agent (frontend/src/views/terminal/terminal/index.vue:526-540), where those records do not exist, so remote saved-host connections break.

Useful? React with 👍 / 👎.

@wanghe-fit2cloud wanghe-fit2cloud changed the title feat: add ai terminal settings WIP: add ai terminal settings Mar 18, 2026
@wanghe-fit2cloud wanghe-fit2cloud marked this pull request as draft March 18, 2026 10:41
@ssongliu ssongliu force-pushed the feat/ai-terminal-settings branch 2 times, most recently from a22466e to 44b4f5c Compare March 19, 2026 06:16
@ssongliu ssongliu marked this pull request as ready for review March 19, 2026 06:16
@ssongliu ssongliu changed the title WIP: add ai terminal settings feat: add ai terminal settings Mar 19, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 44b4f5ca81

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +51 to +53
model := strings.TrimSpace(account.Model)
if model == "" {
model = defaultModelForProvider(provider)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Resolve AI terminal model from persisted account models

ResolveGeneratorConfig only reads agent_accounts.model, but newly created accounts now keep their selectable models in agent_account_models and leave Model empty (agent/app/service/agents.go:530-537). For providers without catalog defaults such as custom/vLLM/Ollama, that means UpdateTerminalAI calls ValidateTerminalAccount with cfg.Model == "", and NewClient rejects the save with model is required. In practice, the new AI terminal setting cannot be enabled for those account types.

Useful? React with 👍 / 👎.

Comment on lines +1123 to +1124
if global.CoreDB == nil || !global.CoreDB.Migrator().HasTable("hosts") {
return nil

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Seed a default host group on fresh installs

This migration exits as soon as there is no legacy core hosts table, so a clean install never gets any groups(type='host') rows. The new host path still assumes a default host group exists (agent/app/service/host.go:262-266), and the terminal “save and connect” drawer just copies that default into form.groupID (frontend/src/views/terminal/terminal/host-create.vue:130-159). On fresh installs, saving a non-local host therefore fails until the user manually creates a host group in a different screen.

Useful? React with 👍 / 👎.

@ssongliu ssongliu force-pushed the feat/ai-terminal-settings branch from 44b4f5c to c446131 Compare March 19, 2026 07:08
Copy link
Member

@wanghe-fit2cloud wanghe-fit2cloud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@wanghe-fit2cloud
Copy link
Member

/approve

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Mar 19, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wanghe-fit2cloud

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot merged commit c2f0c8c into dev-v2 Mar 19, 2026
3 checks passed
@f2c-ci-robot f2c-ci-robot bot deleted the feat/ai-terminal-settings branch March 19, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants